{extend name="public/base" /}
{block name="css"}
{load href="https://ujia-res.oss-cn-shenzhen.aliyuncs.com/common/third-party/swiper/5.0.3/dist/swiper.min.css" /}
<style>
  .main-container {

  }

  .single-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .multi-3-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .item {
    display: flex;
    justify-content: space-between;
    overflow: hidden;
    background: #ffffff;
    padding: 0 40px;
  }


  .item > .cover {
    width: 160px;
    height: 160px;
    flex: .35;
    min-width: 160px;
  }

  .item > .content {
    display: flex;
    flex: 1;
    padding: 0 0 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .content > .title {
    font-size: 19px;
    color: #333333;
    font-weight: 400;
  }

  .title:hover {
    color: #006428;
  }

  .content > .summary {
    color: #999999;
    letter-spacing: 2px;
  }

  .content > .footer {
    display: flex;
    justify-content: space-between;
  }

  .content > .footer > div {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .content > .footer > div > img {
    width: 22px;
    vertical-align: center;
  }

  .content > .footer > div > span {
    font-size: 14px;
    color: #333333;
  }

  .content > .footer > a {
    border: 1px #666 solid;
    padding: 5px 20px;
    color: #666;
    cursor: pointer;
  }

  .content > .footer > a:hover {
    border: 1px #93412C solid;
    color: #93412C;
  }

  .pagination {
    margin: 0 !important;
  }

  .pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover {
    z-index: 3;
    color: #fff;
    cursor: default;
    background-color: #93412C;
    border-color: #93412C;
  }

  .pagination>li>a, .pagination>li>span {
    position: relative;
    float: left;
    padding: 6px 12px;
    margin-left: -1px;
    line-height: 1.42857143;
    color: #93412C;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #ddd;
  }

  .newest {
    display: flex;flex-direction: column;
  }

  .newest > a {
    line-height: 35px;
    color: #555;
    font-size: 16px;
  }

  .newest > a:hover {
    color: #93412C;
  }

  .form-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
  }

  .form-item > span {
    font-size: 15px;
  }

  .form-item > input {
    border-radius: 3px;
    width: 210px;
  }


  select {
    padding-right: 0 !important;
  }

  .submit, .consult, .bottom-submit {
    margin: 0 auto;
    width: 120px;
    height: 35px;
    border-radius:4px;
    border: 0;
    background: #884233;
    color: #FFFFFF;
  }

  .prev-next {
    display: flex;
    justify-content: space-between;
    margin: 40px 0 0;
  }

  .prev-next > a {
    margin-bottom: 20px;
    color: #9A9A9A;
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .prev-next > a:hover {
    color: #93412C;
  }

  .bottom-order-title::before {
    content: '';
    top: 5px;
    left: 0;
    width: 5px;
    height: 26px;
    background: #884233;
    position: absolute;
  }

</style>
{/block}
{block name="main"}
<section class="container-fluid main-container">
  <!-- banner -->
  <div class="row" style="position: relative">
    <img alt="" style="width: 100vw" class="img-responsive" src="https://res.bestyoujia.com/web/UJGC/static/banner_gsdt.png">
  </div>
  <!-- banner end -->

  <div>
    <div class="mx-auto" style="max-width: 1200px;height: 60px;display: flex;align-items: center;">
      <a href="{$Request.root.true}" style="color: #999999">首页</a><span style="color: #999999;margin: 0 6px 0 10px">/</span> <a href="{$Request.root}/news.html" style="color: #999999;margin: 0 0 0 0">{$category.name}</a> <span style="color: #999999;margin: 0 6px">/</span><span>{$article.title}</span>
    </div>
  </div>

  <div class="d-flex flex-column container-fluid" style="background:#FAFAFA;position: relative">
  <div class="row" style="width: 1200px;margin: 30px auto;overflow: hidden;">
    <div style="margin-bottom: 50px;display: flex;position: relative;">
      <div style="background: #FFFFFF">
        <div style="border: 1px #CCCCCC solid;width: 840px;padding: 30px 40px">
          <h3 style="color: #343434;line-height: 30px;font-size: 24px">{$article['title']}</h3>
          <div style="color: #9A9A9A">
            <span>类别：{$category['name']}</span>
            <span style="margin: 0 20px">编辑：{$article['author']}</span>
            <span>时间：{$article['publish_time']}</span>
            <hr style="background: #CCCCCC;border:0;margin: 25px 0;height: 1px" />
            <div>
              {$article['content']|raw}
            </div>
          </div>
          <div class="prev-next">
            {gt name="$prev['id']" value="0"}<a href="{$Request.root}/article/{$prev['id']}.html">上一篇：{$prev['title']}</a>{else/}<span></span>{/gt}
            {gt name="$next['id']" value="0"}<a href="{$Request.root}/article/{$next['id']}.html">下一篇：{$next['title']}</a>{/gt}
          </div>
        </div>

        <div style="border: 1px #CCCCCC solid;width: 840px;padding: 30px 40px;margin-top: 20px">
          <div class="bottom-order-title" style="position: relative;color: #884233;font-size: 24px;font-weight: 500;padding-left: 15px">致美优家-专注成都精装房一站式美学整配服务</div>
          <div style="margin-top: 20px">
            <input id="bottom-customer" placeholder="您的名字" style="height:36px;padding-left: 8px;
background: #FAFAFA;
border: 1px solid #DCDCDC;width: 150px;
border-radius: 4px;" />
            <input id="bottom-mobile" placeholder="您的联系方式" style="margin: 0 20px;height:36px;padding-left: 8px;
background: #FAFAFA;
border: 1px solid #DCDCDC;width: 150px;
border-radius: 4px;" />
            <input id="bottom-building" placeholder="您的小区名称" style="height:36px;padding-left: 8px;
background: #FAFAFA;
border: 1px solid #DCDCDC;width: 150px;
border-radius: 4px;" />
            <button class="bottom-submit" style="width: 145px;margin-left: 20px">立即预约</button>
          </div>
        </div>
      </div>
      <div data-sticky-container style="width: 340px;max-width: 340px;margin-left: 20px;">
        <div style="border: 1px #CCCCCC solid;padding: 20px">
          <div style="color: #343434;font-size: 19px;font-weight: 400">最新动态</div>
          <hr>
          <div class="newest">
            {volist name="newest" id="v"}
            <a class="single-text" href="{$Request.root}/article/{$v.id}.html">{$v.title}</a>
            {/volist}
          </div>
        </div>

        <div data-sticky data-margin-top="50"  id="side-order" style="border: 1px #CCCCCC solid;padding: 20px;margin-top: 20px;background: #FFFFFF">
          <div style="color: #343434;font-size: 19px;font-weight: 500">免费家装顾问<br /><div style="font-size: 15px">全程跟踪服务,避免装修陷阱</div></div>
          <hr>
          <div class="newest">
            <div class="form-item">
              <span>*您的名字：</span>
              <input id="customer" style="height:30px;border: 1px #CCCCCC solid" />
            </div>
            <div class="form-item">
              <span>*联系方式：</span>
              <input id="mobile" type="number" style="height:30px;border: 1px #CCCCCC solid" />
            </div>
            <div class="form-item">
              <span><span style="visibility: hidden">*</span>小区名称：</span>
              <input id="building" type="tel" style="height:30px;border: 1px #CCCCCC solid" />
            </div>
            <div style="margin: 10px 0 20px;text-align: center;color: #999999;font-size: 13px">*为了您的权益，您的隐私将被严格保密</div>
            <div style="display: flex;justify-content: space-between">
              <button class="submit" style="background: #884233">预约顾问</button>
              <button class="consult" onclick="window.open('https://tb.53kf.com/code/client/5a94a95735e35494ea43bac6762f40560/1')"  style="background: #884233">在线咨询</button>
            </div>
          </div>
        </div>

        <div style="border: 1px #CCCCCC solid;padding: 20px;margin-top: 20px;width: 340px;max-width: 340px;">
          <div style="color: #343434;font-size: 19px;font-weight: 500">专注精装房<br />一站式美学整配服务</div>
          <hr>
          <div style="color: #9A9A9A;font-size: 14px">不止设计，更有温度</div>
          <div style="color: #9A9A9A;font-size: 14px">不止省心，更有品质</div>
          <div style="color: #9A9A9A;font-size: 14px">不止拎包，更有颜值</div>
          <div class="newest">
            <div style="margin-top: 30px;display: flex;padding: 0 15%;justify-content: space-between">
              <div><img  src="https://u-res.oss-cn-chengdu.aliyuncs.com/web/ZMYJ/assets/img/news/dz.png"></div>
              <div><img  src="https://u-res.oss-cn-chengdu.aliyuncs.com/web/ZMYJ/assets/img/news/jj.png"></div>
            </div>
            <div style="margin: 25px 0;display: flex;padding: 0 15%;justify-content: space-between">
              <div><img src="https://u-res.oss-cn-chengdu.aliyuncs.com/web/ZMYJ/assets/img/news/cl.png"></div>
              <div><img  src="https://u-res.oss-cn-chengdu.aliyuncs.com/web/ZMYJ/assets/img/news/dj.png"></div>
            </div>
            <div style="display: flex;padding: 0 15%;justify-content: space-between">
              <div><img src="https://u-res.oss-cn-chengdu.aliyuncs.com/web/ZMYJ/assets/img/news/rs.png"></div>
              <div><img src="https://u-res.oss-cn-chengdu.aliyuncs.com/web/ZMYJ/assets/img/news/jzgz.png"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  </div>
</section>
{/block}
{block name="js"}
{load href="https://res.bestyoujia.com/common/third/sticky.compile.js" /}
<script>
  $('.navbar-nav').children('li').eq(9).addClass('nav-active');

  const imgDom = document.querySelectorAll('img');
  for (let i = 0; i < imgDom.length; i++) {
    if (imgDom[i].src.match("jpg")) {
      imgDom[i].src = `${imgDom[i].src}?x-oss-process=image/format,jpg/interlace,1`;
    }
  }

  const sticky = new Sticky('[data-sticky]');

  $('.submit').click(function() {
    window.page_position = '公司动态';
    const customer = $('#customer').val();
    const mobile = $('#mobile').val();
    const building = $('#building').val();

    if(!customer) {
      showWarnTips('请输入您的姓名', '#customer');
      return;
    }
    if(!mobile) {
      showWarnTips('请输入联系方式', '#mobile');
      return;
    }

    switch (validMobile(mobile)) {
      case 0:
        showWarnTips('手机号格式不正确', '#mobile');
        break;
      case 1:

        const data = { mobile, building, customer };
        doAppointment(data,
          function(res) {
            console.log('onAppointmentSuccess', res);
            const { data = '' } = res;
            if(data) {
              buryingPoint('APPOINTMENT', data);
              layer.msg('预约成功，我们将在2小时内联系您', {
                icon: 6,
                time: 1200
              });
              $('#mobile').val('');
              $('#building').val('');
              $('#customer').val('');
            }
          }, function(err) {
            console.log('onAppointmentError', err);
            $('#mobile').val('');
            $('#building').val('');
            $('#customer').val('');
            alert('出错啦，欢迎致电400-6166-002');
          });
        break;
      case 2:
        showWarnTips('请输入手机号', '#mobile');
        break;
      default:
        break;
    }
  });

  $('.bottom-submit').click(function() {
    window.page_position = '公司动态';
    const customer = $('#bottom-customer').val();
    const mobile = $('#bottom-mobile').val();
    const building = $('#bottom-building').val();

    if(!customer) {
      showWarnTips('请输入您的姓名', '#bottom-customer');
      return;
    }
    if(!mobile) {
      showWarnTips('请输入联系方式', '#bottom-mobile');
      return;
    }

    switch (validMobile(mobile)) {
      case 0:
        showWarnTips('手机号格式不正确', '#bottom-mobile');
        break;
      case 1:

        const data = { mobile, building, customer };
        doAppointment(data,
          function(res) {
            console.log('onAppointmentSuccess', res);
            const { data = '' } = res;
            if(data) {
              buryingPoint('APPOINTMENT', data);
              layer.msg('预约成功，我们将在2小时内联系您', {
                icon: 6,
                time: 1200
              });
              $('#bottom-mobile').val('');
              $('#bottom-building').val('');
              $('#bottom-customer').val('');
            }
          }, function(err) {
            console.log('onAppointmentError', err);
            $('#bottom-mobile').val('');
            $('#bottom-building').val('');
            $('#bottom-customer').val('');
            alert('出错啦，欢迎致电400-6166-002');
          });
        break;
      case 2:
        showWarnTips('请输入手机号', '#bottom-mobile');
        break;
      default:
        break;
    }
  });

  function showWarnTips(msg, dom) {
    layer.tips(msg, dom, {
      tips: [1, '#fa8c16'],
      time: 2000
    });
  }
</script>
{/block}